#include<stdio.h>
#include<unistd.h>
#include<stdlib.h>
#include<sys/types.h>
#include<sys/wait.h>
    
int main()
{
    pid_t id=fork();
    if(id==0)
    {
        execl("/bin/ls","ls","-a","-l",NULL);
        exit(0);
    }
    else
    {
        printf("befor pid %d\n",id);
        waitpid(id,NULL,0);
        printf("after pid %d\n",id);
    }
}
